package diamondRingService.impl;

import diamondRingDao.impl.DiamondRingDaoImpl;
import diamondRingEntity.Collection;
import diamondRingEntity.DiamondRingEntity;
import diamondRingEntity.Shooping;
import diamondRingService.DiamondRingService;

import java.util.List;

public class DiamondRingServiceImpl implements DiamondRingService {
    DiamondRingDaoImpl bo=new DiamondRingDaoImpl();
    @Override
    public List<DiamondRingEntity> diamond() {
        List<DiamondRingEntity> diamondRingEntities=bo.diamond();
        return diamondRingEntities;
    }

    @Override
    public List<DiamondRingEntity> salesvolumefind(String sales) {
        List<DiamondRingEntity> diamondRingEntities=bo.salesVolumeFind(sales);
        return diamondRingEntities;
    }

    @Override
    public List<DiamondRingEntity> pricefind(String price) {
        List<DiamondRingEntity> diamondRingEntities=bo.priceFind(price);
        return diamondRingEntities;
    }

    @Override
    public List<DiamondRingEntity> seriesfind(String series) {
        List<DiamondRingEntity> diamondRingEntities=bo.seriesFind(series);
        return diamondRingEntities;
    }

    @Override
    public List<DiamondRingEntity> vaguefind(String vague) {
        List<DiamondRingEntity> diamondRingEntities=bo.vagueFind(vague);
        return diamondRingEntities;
    }

    @Override
    public DiamondRingEntity goodsNews(int id) {
        DiamondRingEntity diamondRingEntityList=bo.goodsNews(id);
        return diamondRingEntityList;
    }

    @Override
    public List<DiamondRingEntity> recordFind(int id) {
        List<DiamondRingEntity> diamondRingEntities=bo.recordFind(id);
        return diamondRingEntities;
    }

    @Override
    public int delGoods(int id) {
        int count=0;
        if (id>0){
            count=bo.delGoods(id);
        }else {
            count=-1;
        }
        return count;
    }

    @Override
    public int EmptyGoods(int userid) {
        int count=0;
        if (userid>0){
            count=bo.EmptyGoods(userid);
        }else {
            count=-1;
        }
        return count;
    }

    @Override
    public List<Shooping> findGoods(int userId) {
        List<Shooping> shoopings=bo.findGoods(userId);
        return shoopings;
    }

    @Override
    public int updateGoods(int size,String lettering, int id) {
        int count=0;
        if (size>0&&id>0){
            count=bo.updateGoods(size,lettering,id);
        }else {
            count=-1;
        }
        return count;
    }

    @Override
    public int insertShoopingGoods(int userId, int id, int quantity) {
        int count=0;
        if (userId>0&&id>0&&quantity>0){
            count=bo.insertShoopingGoods(userId,id,quantity);
        }else{
            count=-1;
        }
        return count;
    }

    @Override
    public int fingShoppingNum(int userid) {
        int count=0;
        if (userid>0){
            count=bo.fingShoppingNum(userid);
        }else {
            count=0;
        }
        return count;
    }

    @Override
    public List<Collection> collectionFind(int collId) {
        List<Collection> collectionList=null;
        if (collId>0){
            collectionList=bo.collectionFind(collId);
        }
        return collectionList;
    }

    @Override
    public int collectionDelete(int id) {
        int count=0;
        if (id>0){
            count=bo.collectionDelete(id);
        }else {
            count=-1;
        }
        return count;
    }

    @Override
    public int collection(int userid, int goodid) {
        int count=0;
        if (userid>0&&goodid>0){
            count=bo.collection(userid,goodid);
        }else {
            count=-1;
        }
        return count;
    }

    @Override
    public List<DiamondRingEntity> finddiamond() {
        return null;
    }
}
